import akshare as ak
from requests.exceptions import JSONDecodeError

try:
    df = ak.stock_zh_a_spot()
except JSONDecodeError as e:
    print(f"原始错误内容:\n{e.doc}")  # 输出包含 '<' 的原始响应
    if "<html>" in e.doc:
        print("⚠️ 数据源返回了错误页面（可能需验证码或登录）")
